package com.jcl.recruit.api.resume.controller;

import com.jcl.core.resp.ApiResponse;
import com.jcl.core.utils.StringUtils;
import com.jcl.recruit.resume.service.ResumeShareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName ResumeShareController

 * @Author yyliu
 * @Date 2018/9/19 14:10
 * @Version 1.0
 **/
@RestController
@RequestMapping("/api")
public class ResumeShareController {

    @Autowired
    private ResumeShareService resumeShareService;

    @RequestMapping("/resume/share")
    public ApiResponse shareResume(String id, String fromType) {

        if(StringUtils.isEmpty(id) || null == fromType){
            return ApiResponse.error("请求简历参数不能为空！");
        }

        Map<String, Object> data =  resumeShareService.getShareResume(Integer.parseInt(id), fromType);

        return ApiResponse.success(data);
    }
}
